<include file="../header" />
<body class="J_scroll_fixed">

    <script>

        $(document).ready(function () {

            $('input#datetime').click(function () {
                var shopId = $('select[name=shopId]').val();
                var day = $(this).attr("day");
                var clock = $(this).attr("name");
                layer.open({
                    type: 2,
                    title: '公开课开设管理',
                    maxmin: false,
                    shadeClose: true, //点击遮罩关闭层
                    area: ['80%', '98%'],
                    content: "{:U('publicCourse/publicOpen')}&day=" + day + "&clock=" + clock + "&shopId=" + shopId,
                    cancel: function(index){
                        window.location.reload();
                    }

                });
            });

        });

    </script>
    <form class="well form-search" method="post" style="float:left;width:100%;" action="{:U('publicCourse/schedule')}">
        <div class="search_type cc mb10">
            <div class="mb10">
                <span class="mr20">
                    店&nbsp;&nbsp;&nbsp;&nbsp;铺：{:getShopSelectHtml($shopId)}

                    <button class="btn btn-primary">搜索</button>
                    <a class="btn" href="{:U('publicCourse/schedule')}">重置</a>
                </span>
            </div>
        </div>
    </form>
    <div class="wrap jj">
        <table class="table table-hover table-bordered">
            <thead>
                <tr>
                    <th>日期</th>
                    <th>时间安排</th>       
                </tr>
            </thead>
            <tbody>
            <volist name="weeksPublicData" id="vo">
                <tr>
                    <td width='20%'>
                        {$vo.day.id}<br/>
                        {$vo.day.week}
                    </td>
                    <td>           
                    <volist name="vo.bookindTimes" id="v" mod='7'> 
                        <if condition=" $v['is_today'] eq $isToday['BEFORE']" >
                            <if condition=" $v['is_book'] eq $isBook['YES']" >
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" class='btn' disabled="true"/>
                                <else/>
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}"  disabled="true"/>
                            </if>   
                        <else/>

                            <if condition=" $v['is_book'] eq $isBook['YES']" >
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" class='btn'/>
                                <else/>
                                <input id='datetime' value="{$v['name']}" type="button" name="{$v['id']}" day="{$vo['day']['id']}" />
                            </if>
                        </if>      
                        <eq name='mod' value='6'><br/></eq>
                    </volist>
                </td>
                </tr>        
            </volist>
            </tbody>
        </table>

    </div>
    <script src="__ROOT__/statics/js/common.js"></script>
</body>
</html>